<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .wrapper{
            width: 600px;
            height: 400px;
            border: 1px solid #000;
            margin: 0 auto;
            position: relative;
        }

        .box1, .box2, .box3{
            width: 150px;
            height: 150px;
            border: 1px dotted red;
            display: inline-block;
        }
        .box1{

        }

        .box2{
            /*不会发生偏移*/
            /*position: static;*/
            /*position: fixed;*/
            /*position: relative;*/
            position: absolute;
            background-color: #FF0000;

            left: 100px;
            top: 100px;
            z-index: -1;
        }
        .box3{
            left: 150px;
            background-color: blue;
            z-index: 1;
        }

    </style>
</head>
<body>
<div class="wrapper">
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</div>
</body>
</html>